package com.smedi.ismedi.constructionproject.api.feign;

import com.smedi.ismedi.constructionproject.api.dto.request.*;
import com.smedi.ismedi.constructionproject.api.dto.response.ProjectApplyResponse;
import com.smedi.ismedi.constructionproject.api.dto.response.ProjectBasicResponse;
import com.smedi.ismedi.web.starter.common.PaginationData;
import com.smedi.ismedi.web.starter.common.ResponseData;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Api(tags = {"项目免装申请接口"})
@FeignClient(name = "ismedi-construction-project")
@RequestMapping(value = "/api/v1/construction-project/apply")
public interface RemoteProjectApplyFeignApi {
    /**
     * 获取 项目免装申请 token
     *
     * @return ResponseData<String>
     */
    @ApiOperation(value = "获取 项目免装申请 token", nickname = "获取 项目免装申请 token")
    @PostMapping(value = "/business-token")
    ResponseData<String> getBusinessToken();

    /**
     * 保存项目申请信息
     *
     * @param
     * @return
     */
    @ApiOperation(httpMethod = "POST", value = "保存项目申请信息")
    @PostMapping(value = "/save")
    ResponseData<ProjectApplyResponse> postSave(@Validated @RequestBody ProjectApplyCreateRequest projectApplyCreateRequest);

    /**
     * 编辑项目申请信息
     *
     * @param
     * @return
     */
    @ApiOperation(httpMethod = "POST", value = "编辑项目申请信息")
    @PostMapping(value = "/edit")
    ResponseData<ProjectApplyResponse> postEdit(@Validated @RequestBody ProjectApplyEditRequest projectApplyEditRequest);

    /**
     * 主体院分管领导审批 项目申请
     *
     * @param processInstituteLeaderApprovalRequest 主体院分管领导审批 项目申请
     * @return ResponseData<ProjectApplyResponse>
     */
    @ApiOperation(value = "主体院分管领导审批 项目申请", nickname = "主体院分管领导审批 项目申请")
    @PostMapping(value = "/project/institute-leader-approval")
    ResponseData<ProjectApplyResponse> instituteLeaderApproval(@Validated @RequestBody ProcessInstituteLeaderApprovalRequest processInstituteLeaderApprovalRequest);

    /**
     * 工程部工程师审批 项目申请
     *
     * @param processEngineerApprovalRequest 工程部工程师审批 项目申请
     * @return ResponseData<ProjectApplyResponse>
     */
    @ApiOperation(value = "工程部工程师审批 项目申请", nickname = "工程部工程师审批 项目申请")
    @PostMapping(value = "/project/engineer-approval")
    ResponseData<ProjectApplyResponse> engineerApproval(@Validated @RequestBody ProcessEngineerApprovalRequest processEngineerApprovalRequest);

    /**
     * 工程部分管领导审批 项目申请
     *
     * @param processEngineeringLeaderApprovalRequest 工程部分管领导审批 项目申请
     * @return ResponseData<ProjectApplyResponse>
     */
    @ApiOperation(value = "工程部分管领导审批 项目申请", nickname = "工程部分管领导审批 项目申请")
    @PostMapping(value = "/project/engineering-leader-approval")
    ResponseData<ProjectApplyResponse> engineeringLeaderApproval(@Validated @RequestBody ProcessEngineeringLeaderApprovalRequest processEngineeringLeaderApprovalRequest);

    /**
     * 总院分管领导审批 项目申请
     *
     * @param processGeneralInstituteLeaderApprovalRequest 总院分管领导审批 项目申请
     * @return ResponseData<ProjectApplyResponse>
     */
    @ApiOperation(value = "总院分管领导审批 项目申请", nickname = "总院分管领导审批 项目申请")
    @PostMapping(value = "/project/general-institute-leader-approval")
    ResponseData<ProjectApplyResponse> generalInstituteLeaderApproval(@Validated @RequestBody ProcessGeneralInstituteLeaderApprovalRequest processGeneralInstituteLeaderApprovalRequest);

    /**
     * 获取 项目申请 列表
     *
     * @param projectApplyListRequest 项目申请 列表 请求
     * @return ResponseData<List < ProjectApplyResponse>>
     */
    @ApiOperation(value = "获取 项目申请 列表", nickname = "获取 项目申请 列表")
    @PostMapping(value = "/project-apply/list")
    ResponseData<List<ProjectApplyResponse>> getProjectApplyList(@Validated @RequestBody ProjectApplyListRequest projectApplyListRequest);

    /**
     * 获取 项目申请 分页
     *
     * @param projectApplyPageRequest 项目申请 分页 请求
     * @return ResponseData<PaginationData < ProjectApplyResponse>>
     */
    @ApiOperation(value = "获取 项目申请 分页", nickname = "获取 项目申请 分页")
    @PostMapping(value = "/project-apply/page")
    ResponseData<PaginationData<ProjectApplyResponse>> getProjectApplyPage(@Validated @RequestBody ProjectApplyPageRequest projectApplyPageRequest);

    /**
     * 获取 项目申请 恢复
     *
     * @param projectId 项目申请 恢复 请求
     * @return ResponseData<PaginationData < ProjectApplyResponse>>
     */
    @ApiOperation(value = "恢复", nickname = "恢复")
    @GetMapping(value = "/restore")
    ResponseData<Boolean> restoreProject(@RequestParam(value = "projectId") Long projectId);

    /**
     * 定时更新项目监控类型
     */
    @ApiOperation(httpMethod = "POST", value = "定时更新项目监控类型")
    @GetMapping(value = "/updateMonitorType")
    ResponseData<Boolean> updateMonitorType();

    /**
     * 获取 项目申请 详情
     *
     * @param id 项目申请 详情
     * @return ResponseData<PaginationData < ProjectApplyResponse>>
     */
    @ApiOperation(value = "详情", nickname = "详情")
    @GetMapping(value = "/detail")
    ResponseData<ProjectApplyResponse> projectApplyDetail(@RequestParam(value = "id") Long id);

    /**
     * 视频监控设置  查看
     *
     * @param projectId 视频监控设置  查看
     * @return ResponseData<PaginationData < ProjectApplyResponse>>
     */
    @ApiOperation(value = "视频监控设置  查看", nickname = "视频监控设置  查看")
    @GetMapping(value = "/view")
    ResponseData<ProjectApplyResponse> view(@RequestParam(value = "projectId") Long projectId);

    /**
     * 根据传入的企业组织id获取项目列表
     *
     * @param hrOrganizationId
     * @return
     */
    @ApiOperation(httpMethod = "GET", value = "根据传入的企业组织id和当前人获取项目列表")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "hrOrganizationId", value = "企业组织id", dataType = "Long", dataTypeClass = Long.class),
    })
    @GetMapping(value = "/getQueryProjectBasicListByHrOrganizationIdAndPerson")
    ResponseData<List<ProjectBasicResponse>> getQueryProjectBasicListByHrOrganizationIdAndPerson(@RequestParam(value = "hrOrganizationId") Long hrOrganizationId);

}
